home *** CD-ROM | disk | FTP | other *** search
- Path: eua.ericsson.se!usenet
- From: euahjn@eua.ericsson.se (Henrik Johansson)
- Newsgroups: comp.lang.c++
- Subject: Re: Visual C++ 4.0 lacking initializers?
- Date: 23 Jan 1996 11:46:55 GMT
- Organization: Ericsson Telecom Systems Labs, Stockholm, Sweden
- Distribution: world
- Message-ID: <4e2hrf$9vt@euas20.eua.ericsson.se>
- References: <31049C46.A26@oz.is>
- Reply-To: euahjn@eua.ericsson.se
- NNTP-Posting-Host: euas31i2c37.eua.ericsson.se
- NNTP-Posting-User: euahjn
-
- In article <31049C46.A26@oz.is>, Hßlfdan Ingvarsson <halfdan@oz.is> writes:
- > Is it me or is this sort of code not possible with VC++ 4.0?
- >
- > // Declarations of class Foo
- >
- > // VC++ Complains about the line below with the error
- > // error C2436: '__ctor' : cannot initialize member functions
- > Foo::Foo(void) : Foo::Foo(10) {}
- >
- > Foo::Foo(x)
- > {
- > // Some stuff
- > }
- >
- > Tell me about it,
-
- Syntax error on a SUN too. Redesign your code. In this perticular case
- I think you shall provide a default value for x and only have one ctor
- Foo(int x = 10);
-
-
-